package redis

import (
	"github.com/go-redsync/redsync/v4"
	"github.com/go-redsync/redsync/v4/redis/goredis/v9"
)

// NewRedsync creates an instance of redisync
// to be used to obtain a mutual exclusion lock.
func (r *Redis) NewRedsync() *redsync.Redsync {
	pool := goredis.NewPool(r.rdb) // or, pool := redigo.NewPool(...)
	return redsync.New(pool)
}
